<div class="search-box">
	<form class="search_form layui-form" lay-filter="invoice_finance_search_form">
		<div class="layui-inline">
			<label class="layui-form-label">开票方式</label>
			<div class="layui-input-inline">
				<select name="builder_type" id="builder_type" lay-filter="builder_type" lay-search>
					<option>全部</option>
					<option value="1">纸质发票</option>
					<option value="2">电子发票</option>
				</select>
			</div>
		</div>
		<div class="layui-inline">
			<label class="layui-form-label">发票抬头</label>
			<div class="layui-input-inline">
				<input type="text" name="invoice_title" autocomplete="off" class="layui-input">
			</div>
		</div>
		<div class="layui-inline">
			<label class="layui-form-label">税号</label>
			<div class="layui-input-inline">
				<input type="text" name="invoice_duty" autocomplete="off" class="layui-input">
			</div>
		</div>
		
		<div class="layui-inline">
			<label class="layui-form-label">订单号</label>
			<div class="layui-input-inline">
				<input type="text" name="order_no" autocomplete="off" placeholder="完整订单号" class="layui-input">
			</div>
		</div>
		
		<div class="layui-inline">
			<label class="layui-form-label">开票</label>
			<div class="layui-input-inline search-radio-box">
				<input type="radio" name="state" value="" title="全部" checked>
				<input type="radio" name="state" value="1" title="未开票">
				<input type="radio" name="state" value="2" title="已开票">
				<input type="radio" name="state" value="3" title="驳回">
			</div>
		</div>
		<div class="layui-inline">
			<label class="layui-form-label">领票</label>
			<div class="layui-input-inline search-radio-box">
				<input type="radio" name="draw_state" value="" title="全部" checked>
				<input type="radio" name="draw_state" value="1" title="已领取">
				<input type="radio" name="draw_state" value="2" title="未领取">
			</div>
		</div>
		<div class="pack-up"></div>
	</form>
</div>
<table class="layui-hide" id="invoice_finance_list" lay-filter="invoice_finance_list"></table>
<script>

	var invoice_list_url = "{:url('Invoice/ajaxList')}",
		invoice_detail_url = "{:url('Invoice/detail')}",
		invoice_view_url = "{:url('Invoice/views')}",
		invoice_find_url = "{:url('Invoice/ajaxFind')}",
		invoice_verify = "{:url('Invoice/verify')}",
		invoice_save_invoice_url = "{:url('Invoice/saveInvoice')}",
		invoice_finance_cols = {$cols};
</script>
<script type="text/html" id="invoice_admin_tool">

	{{#
		var return_html  ='<div class="layui-btn-group">';
		return_html = return_html + '<a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="recieve_view" data-title="查看明细"><i class="layui-icon layui-icon-table"></i></a>';
		if(d.state == 1){
			return_html = return_html+'<a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="make_invoice" data-title="开具发票"><i class="layui-icon layui-icon-tabs"></i></a>';
			return_html = return_html+'<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="return_invoice" data-title="驳回"><i class="layui-icon layui-icon-refresh"></i></a>';
		} else if(d.state == 2){
			if(d.builder_type == 1){
				if(d.draw_state == 2){
					return_html = return_html+ '<a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="set_draw" data-title="领取码领票"><i class="layui-icon layui-icon-vercode"></i></a>';
				}
			}
		}
		return_html = return_html+'</div>';
		return return_html;
	}}
	</div>
</script>
<script type="text/html" id="invoice_proofTpl">
	{{# if(d.invoice_proof){ return '<a href="'+d.invoice_proof.save_path+'" target="_blank">查看</a>'; } }}
</script>

<script type="text/html" id="stateTpl">
	{{# if(d.state == 1){}}
	<div class="layui-anim circle layui-bg-red" data-title="未开票">
		<i class="layui-icon layui-icon-radio"></i>
	</div>
	{{# }else if(d.state == 3) { }}
	<div class="layui-anim circle layui-bg-cyan" data-title="已被驳回">
		<i class="layui-icon layui-icon-radio"></i>
	</div>
	{{# } else {}}
	<div class="layui-anim circle layui-bg-blue" data-title="已开票">
		<i class="layui-icon layui-icon-radio"></i>
	</div>
	{{# }}}
</script>
<script type="text/html" id="builder_typeTpl">
	{{# if(d.builder_type == 1){}}
	<div class="layui-anim circle layui-bg-red" data-title="纸质发票">
		<i class="layui-icon layui-icon-radio"></i>
	</div>
	{{# } else {}}
	<div class="layui-anim circle layui-bg-blue" data-title="电子发票">
		<i class="layui-icon layui-icon-radio"></i>
	</div>
	{{# }}}
</script>
<script type="text/html" id="draw_stateTpl">
	{{# if(d.draw_state == 1){}}
	<div class="layui-anim circle layui-bg-blue" data-title="已领取">
		<i class="layui-icon layui-icon-radio"></i>
	</div>
	{{# } else {}}
	<div class="layui-anim circle layui-bg-red" data-title="未领取">
		<i class="layui-icon layui-icon-radio"></i>
	</div>
	{{# }}}
</script>
<script type="text/html" id="post_stateTpl">
	{{# if(d.post_state == 1){}}
	<div class="layui-anim circle layui-bg-blue" data-title="已配送">
		<i class="layui-icon layui-icon-radio"></i>
	</div>
	{{# } else {}}
	<div class="layui-anim circle layui-bg-red" data-title="未配送">
		<i class="layui-icon layui-icon-radio"></i>
	</div>
	{{# }}}
</script>
<script type="text/html" id="receive_stateTpl">
	{{# if(d.receive_state == 1){}}
	<div class="layui-anim circle layui-bg-blue" data-title="已收货">
		<i class="layui-icon layui-icon-radio"></i>
	</div>
	{{# } else {}}
	<div class="layui-anim circle layui-bg-red" data-title="未收货">
		<i class="layui-icon layui-icon-radio"></i>
	</div>
	{{# }}}
</script>
